<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 400px;
            margin: auto;
        }

        .circle {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            color: aliceblue;
            border: 2px solid yellowgreen;
            text-align: center;
            line-height: 50px;
            display: inline-block;
        }

        .circle:nth-child(2n) {
            background-color: black;
        }

        .circle:nth-child(2n+1) {
            background-color: blue;
        }
    </style>
</head>

<body>
    <div class="box">
        <span class="circle">1</span>
        <span class="circle">2</span>
        <span class="circle">3</span>
        <span class="circle">4</span>
        <span class="circle">5</span>
        <span class="circle">6</span>
        <span class="circle">7</span>
        <span class="circle">8</span>
        <span class="circle">9</span>
        <span class="circle">10</span>
        <span class="circle">11</span>
        <span class="circle">12</span>
        <span class="circle">13</span>
        <span class="circle">14</span>
        <span class="circle">15</span>
        <span class="circle">16</span>
        <span class="circle">17</span>
        <span class="circle">18</span>
        <span class="circle">19</span>
        <span class="circle">20</span>
        <span class="circle">21</span>
    </div>
</body>

</html>